#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int result;
int main(int argc, char *argv[]){
printf("main_add pid: %d\n", getpid());
int a = 0;
int b = 0;
a = atoi(argv[2]);
b = atoi(argv[3]);
char op = *argv[1];
switch (op){
case '+':
result = a + b;
break;
case '-':
result = a - b;
break;
case '*':
result = a * b;
break;
case '/':
result = a / b;
break;
default:
printf("input error!\n");
//exit(-1);
}
printf("%d %c %d = %d\n", a, op, b, result);
return 0;
}
